import axios from 'axios'

const service = axios.create({
  baseURL: process.env.VUE_APP_URL,
  timeout: 10000
})

// request拦截器
service.interceptors.request.use(
  config => {
    config.headers['Authorization'] = 'eyJhbGciOiJIUzI1NiJ9.eyJpZCI6InJvb3QifQ.-YvS-ybEwfA3yKWs0STuPLM1qywZXDaYW-arL2iW80A' // 让每个请求携带自定义token 请根据实际情况自行修改
    return config
  },
  error => {
    // Do something with request error
    console.log(error) // for debug
    Promise.reject(error)
  }
)

export default service
